//Source file: D:\\test\\com\\ce\\pms\\charge\\model\\PrePaySchDomain.java

package com.ce.pms.charge.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

import com.ce.pms.common.model.SysInfo;
import com.ce.pms.common.model.SysrefcodeDO;
import com.ce.pms.house.model.ImageDomain;
import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体名称:预交方案 关联数据表:FEE_PRE_PAY_SCH
 * @author Adama Yue
 * @CreateDate:2008-7-11
 */
@Entity
@Table(name = "FEE_PRE_PAY_SCH")
public class PrePaySchDomain implements IDomainObject{
	/**
	 * 默认方案标志
	 */
	public static final String IS_DEFAULT=SysrefcodeDO.CONSTANTS_DIGITAL_ONE;
	
	/**
	 * 非默认方案标志
	 */
	public static final String IS_NOT_DEFAULT=SysrefcodeDO.CONSTANTS_DIGITAL_ZERO;
	
	/**
	 * 主键
	 */
	@Id
	@GeneratedValue
	@Column(name = "PRE_PAY_SCH_ID")
	private Long prePaySchId;

	/**
	 * 方案代码
	 */
	@Column(name = "SCHEME_CODE", length = 30)
	private String schemeCode;

	/**
	 * 方案名称
	 */
	@Column(name = "SCHEME_NAME", length = 50, nullable = false)
	private String schemeName;

	/**
	 * 是否默认
	 */
	@Column(name = "IS_DEFAULT", length = 1, nullable = false)
	private String isDefault;

	/**
	 * 备注
	 */
	@Column(name = "REMARK", length = 500)
	private String remark;

	/**
	 * 方案明细 检索策略:lazy=true 级联配置:cascade=all-delete-orphan
	 */
	@OneToMany(cascade={CascadeType.ALL},fetch=FetchType.LAZY, mappedBy="prePaySch")
	@org.hibernate.annotations.Cascade({
		org.hibernate.annotations.CascadeType.DELETE_ORPHAN
	})
	private Set<SchDetail> schDetails = new HashSet<SchDetail>();

	/**
	 * 预交款帐户检索 检索策略:lazy=true 级联配置:cascade=refresh <br>
	 *
	 * Create author:付湘辉 <br>
	 * Create on:2008-8-7  <br>
	 * Edit author:  <br>
	 * Edit on:    <br>
	 * Why:     <br>
	 */
	@OneToMany(cascade={CascadeType.REFRESH},fetch=FetchType.LAZY)
	@JoinTable(name="FEE_PRE_ACCOUNT_SCH",
			 joinColumns={@JoinColumn(name="PRE_PAY_SCH_ID")},
			 inverseJoinColumns={@JoinColumn(name="PART_ACCOUNT_ID")}
	 )
	private Set<PrePayAccountDomain> prePayAccountes = new HashSet<PrePayAccountDomain>();

	@Embedded
	private SysInfo sysInfo;

	/**
	 * @roseuid 48757D160242
	 */
	public PrePaySchDomain() {

	}

	public PrePaySchDomain(String schemeName, String isDefault, SysInfo sysInfo) {
		super();
		this.schemeName = schemeName;
		this.isDefault = isDefault;
		this.sysInfo = sysInfo;
	}
	/*********************************************
	 * Accessors and modifiers
	 *********************************************/

	public String getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(String isDefault) {
		this.isDefault = isDefault;
	}

	public Long getPrePaySchId() {
		return prePaySchId;
	}

	public void setPrePaySchId(Long prePaySchId) {
		this.prePaySchId = prePaySchId;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Set<SchDetail> getSchDetails() {
		return schDetails;
	}

	public void setSchDetails(Set<SchDetail> schDetails) {
		this.schDetails = schDetails;
	}

	public String getSchemeCode() {
		return schemeCode;
	}

	public void setSchemeCode(String schemeCode) {
		this.schemeCode = schemeCode;
	}

	public String getSchemeName() {
		return schemeName;
	}

	public void setSchemeName(String schemeName) {
		this.schemeName = schemeName;
	}

	public SysInfo getSysInfo() {
		return sysInfo;
	}

	public void setSysInfo(SysInfo sysInfo) {
		this.sysInfo = sysInfo;
	}

	/**
	 * @return the prePayAccountes
	 */
	public Set<PrePayAccountDomain> getPrePayAccountes() {
		return prePayAccountes;
	}

	/**
	 * @param prePayAccountes the prePayAccountes to set
	 */
	public void setPrePayAccountes(Set<PrePayAccountDomain> prePayAccountes) {
		this.prePayAccountes = prePayAccountes;
	}

}
